﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Admin.ViewModels.ArticleEditViewModel>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Thông tin bài viết
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
    Chi tiết bài viết
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
    <td>
        <%= Html.Toolbar("Quay về", "/Article", "back") %>
        <%= Html.Toolbar("Thêm mới", "/Article/Create/", "new")%>
	    <%= Html.Toolbar("Sửa", string.Format("/Article/Edit/{0}", Model.Article.ID), "edit")%>
        <%= Html.Toolbar("Xóa", string.Format("/Article/Delete/{0}", Model.Article.ID), "delete")%>
    </td>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%if (ViewData["MessageInfo"] == null)
      { %>
    <%= Html.ValidationSummary(true)%>
    <table class="adminlist" width="700px" align="center">
        <tbody>
            <%--<tr>
                <td class="key">Ảnh đại diện</td>
                <td><img class="represent" alt="<%=Model.Article.Title %>" src="<%= string.Format("{0}{1}", Model.ImageRootUrl,""+Model.Article.ID+"_"+ Model.Article.ImagePath) %>" /></td>
            </tr>
            <tr>
                <td class="key">Ngày viết</td>
                <td><%=string.Format("{0:dd/MM/yyyy}", Model.Article.AddDate)%></td>
            </tr>
            <tr>
                <td class="key">Tiêu đề</td>
                <td><%=Model.Article.Title%></td>
            </tr>
            <tr>
                <td class="key">Tóm tắt</td>
                <td><%=Model.Article.Summary%></td>
            </tr>--%>
            <tr>
                <td>
                   	<div>
				        <div class="div_img">
	                         <img width="125px" height="95px" class="represent" alt="<%=Model.Article.Title %>" src="<%= string.Format("{0}{1}", Model.ImageRootUrl,""+Model.Article.ID+"_"+ Model.Article.ImagePath) %>" />
	                    </div>
				        <div class="div_content">				           
				        </div>
				    </div>
                </td>
                <td>
                <div class="summary">
                    <%= Html.Encode(Model.Article.Title) %><br/>
                    Ngày viết <%= string.Format("{0:dd/MM/yyyy}",Model.Article.AddDate)%><br />
                    <p align="left"><%=Html.Encode(Model.Article.Summary)%></p>
                 </div>   
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <p><%= Model.Article.ArticleContent%></p>
                </td>
            </tr>
            <tr>
                <td class="key">Danh sách tags</td>
                <td>
                    <%foreach (var itemtag in Model.Tags)
                      {
                        if (Model.ListTagID.Contains(itemtag.ID)) {  %>
                        <%=itemtag.Keyword%>,
                    <%}} %>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Trạng thái hiển thị
                </td>
                <td>
                    <%= Html.Encode(Model.Article.PubYN)%>
                </td>
            </tr>
            <tr>
                <td class="key">MetaDescription</td>
                <td><%=Html.Encode(Model.Article.MetaDescription) %></td>
            </tr>
            <tr>
                <td class="key">MetaKeyword</td>
                <td><%=Html.Encode(Model.Article.MetaKeyword) %></td>
            </tr>
            <tr>
                <td class="key">MetaTag</td>
                <td><%=Html.Encode(Model.Article.MetaTag) %></td>
            </tr>
            <tr>
                <td class="key">Bài viết trong sự kiện</td>
                <td><%= Model.CurrentEvent == null ? string.Empty : Model.CurrentEvent.Title%></td>
            </tr>
            <tr>
                <td class="key">Bài viết trong dự án</td>
                <td><%= Model.CurrentProject == null ? string.Empty : Model.CurrentProject.Title%></td>
            </tr>
            <tr>
                <td class="key">Bài viết cho thuộc doanh nghiệp</td>
                <td><%= Model.CurrentCompany == null ? string.Empty: Model.CurrentCompany.Name %></td>
            </tr>                                    
            <tr>
                <td class="key">
                    Độ ưu tiên
                </td>
                <td>
                    <%= Html.Encode(Model.Article.Priority)%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Tin nổi bật
                </td>
                <td>
                    <%= Html.Encode(Model.Article.HotYN)%>
                </td>
            </tr>
            <tr>
                <td class="key">Danh sách file đính kèm</td>
                <td>
                    <table class="adminlist">
                        <thead>
                            <tr>
                                <th>Tên tài liệu</th>
                                <th>Tải về</th>
                            </tr>
                        </thead>
                        <tbody>
                            <%  foreach (var itemDocument in Model.Documents)
                                {
                                    if (Model.ListDocumentID.Contains(itemDocument.ID))
                                    {        
                            %>  
                                <tr>
                                    <td class="key"><%=itemDocument.Name%></td>
                                    <td><a href="<%=string.Format("{0}{1}_{2}",Model.FileRootURL,itemDocument.ID,itemDocument.Path) %>" title="Tải về">Tải về</a></td>
                                </tr>
                            
                            <%}
                                } %>  
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <%
  } %>
</asp:Content>
